<?php
declare (strict_types = 1);
namespace app\course\model\live\admin;

use app\course\model\base\CourseSection as BaseCourseSection;
use think\model\concern\SoftDelete;

/**
 * 点播课程--后台管理
 */
class LiveSmallSection extends BaseCourseSection
{
    use SoftDelete;

    protected $globalScope = ['courseType'];

    /**
     * 点播课程条件
     * Author   Martinsun<syh@sunyonghong.com>
     * Date 2020-04-28
     * @param    [type]                         $query [description]
     * @return   [type]                                [description]
     */
    public function scopeCourseType($query)
    {
        $query->partition('p2');
    }

    /**
     * 新增数据事件
     * Author   Martinsun<syh@sunyonghong.com>
     * Date 2020-03-14
     * @return   string
     */
    public static function onBeforeInsert($course)
    {
        $course->course_type = 2;
    }

    /**
     * 创建之后
     * Author   Martinsun<syh@sunyonghong.com>
     * Date 2020-03-14
     * @param    [type]                         $course [description]
     * @return   [type]                               [description]
     */
    public static function onAfterInsert($course)
    {

    }

    /**
     * 成功删除之后
     * Author   Martinsun<syh@sunyonghong.com>
     * Date 2020-03-14
     * @param    [type]                         $course [description]
     * @return   [type]                               [description]
     */
    public static function onAfterDelete($course)
    {

    }
}
